using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Private_Admin_RoomControl : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GridViewRooms.DataSource = DAO.Room.GetFree();
        GridViewRooms.DataBind();
        if (!Page.IsPostBack)
        {
            DropDownListType.DataSource = DAO.RoomType.Get();
            DropDownListType.DataTextField = "Name";
            DropDownListType.DataBind();
        }
    }
    protected void ButtonSubmit_Click(object sender, EventArgs e)
    {
        DAO.Room.InsertRoom(TextBoxRoomNumber.Text, DropDownListType.SelectedValue);
        OnLoad(new EventArgs ());
    }
}
